import React, { Component } from "react";

export default class Son extends Component {

    constructor(props){
        super(props);
        this.state={
            price:18
        }
    }

    componentWillUpdate(){
        console.log("son:componentWillUpdate");
    }

  componentWillReceiveProps() {
    console.log("son:componentWillReceiveProps");
  }


  render() {
    return <div>
        <h2>子组件</h2>
        
        <p>price:{this.state.price}</p>
        <p>age:{this.props.age}</p>
    </div>;
  }
}
